﻿/*************************************************************************
 *  Copyright (C), 2015-2016, Mogoson Tech. Co., Ltd.
 *------------------------------------------------------------------------
 *  File         :  Exchanger.cs
 *  Description  :  Exchange objects.
 *------------------------------------------------------------------------
 *  Author       :  Mogoson
 *  Version      :  0.1.0
 *  Date         :  10/25/2015
 *  Description  :  Initial development version.
 *************************************************************************/

namespace Developer.Exchanger
{
    /// <summary>
	/// Exchange objects.
	/// </summary>
	public static class Exchanger
    {
        #region Public Static Method
        /// <summary>
        /// Exchange two objects
        /// </summary>
        /// <typeparam name="T">Object type</typeparam>
        /// <param name="objectA">Exchange operand A</param>
        /// <param name="objectB">Exchange operand B</param>
        public static void Exchange<T>(ref T objectA, ref T objectB)
        {
            var tempObject = objectA;
            objectA = objectB;
            objectB = tempObject;
        }
        #endregion
    }
}